package com.xzx.java.kit.basic;

import java.util.Objects;

/**
 * @author xinzhixuan
 * @version V1.0
 * @date 2017/12/13 14:34
 */
public abstract class Person {
    protected String name;
    protected int age;

    @Override
    public boolean equals(Object other) {
        if (this == other) {
            return true;
        }

        if (other == null) {
            return false;
        }

        if (!(other instanceof Person)) {
            return false;
        }

        Person person = (Person) other;
        return Objects.equals(name, person.name) && age == person.age;
    }
}
